import React, { Component } from 'react'
const withFooter = (Com) => { // Com就是一个组件
  return class extends Component {
    state = {
      count: 100
    }
    componentDidMount () {
      console.log('1111111')
    }
    render () {
      return(
        <>

          <Com />
          { this.state.count }
          <button onClick = { () => {
            this.setState({
              count: this.state.count + 10
            })
          }}>加10</button>
          <div>&copy;版权所有 千锋教育 2021 </div>
        </>
      )
    }
  }
}
// 
class App extends Component {
  
  componentDidMount () {
    console.log('2222222')
  }
  render() {
    return (
      <div>
        Hoc - 
      </div>
    )
  }
}

App = withFooter(App)
export default App